﻿using Microsoft.Extensions.Configuration;
using System.IO;

namespace BlazorProject.Common.Configuration
{
    public class ConfigurationService
    {
        private static IConfiguration configuration;
        public static IConfiguration GetConfiguration()
        {
            if (configuration == null)
            {
                configuration = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory())
                    .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                    .Build();
            }
            return configuration;
        }
    }
}
